<template>
<!-- 专辑 -->
  <div class="content">
    <span class="iconfont icon-fangxianganniu1" @click="$router.go(-1)"></span>
    <ul>
      <li v-for="ele in AlbumList" :key="ele.id" @click="Albumplay(ele.id)">
        <div class="hotbox">
          <img :src="ele.al.picUrl" alt="" />
        </div>
        <h5>{{ ele.name }}</h5>
      </li>
    </ul>
  </div>
</template>

<script>
import { getAlbumContent } from "../../api/Album";
export default {
  props: ["id"],
  data() {
    return {
      AlbumList: null,
    };
  },
  methods: {
    Albumplay(id) {
      this.$emit("get-player-id",id);
    },
  },
  created() {
    getAlbumContent(this.id).then((data) => {
      this.AlbumList = data.songs;
      console.log(this.AlbumList);
    });
  },
};
</script>

<style lang="less" scoped>
.content {
  position: relative;
  span {
    position: absolute;
    font-size: 30px;
    top: -34px;
    left: 10px;
  }
  ul {
    margin-top: 34px;
    li {
      display: flex;
      margin-top: 20px;
      padding: 10px 16px;
      color: #323233;
      font-size: 14px;
      line-height: 24px;
      background-color: #fff;
      .hotbox {
        width: 45px;
        height: 45px;
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
  }
  h5 {
    padding: 22px 8px 0 16px;
    margin-left: 20px;
    width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
</style>